"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const appRouter = (app) => {
    fs_1.default.readdirSync(__dirname).forEach((file) => {
        if (file === "index.ts" || file === "index.js") {
            return;
        }
        else {
            const route = require(`./${file}`).default;
            app.use(route.routes()).use(route.allowedMethods()); //allowedMethods 允许使用options方法
        }
    });
};
exports.default = appRouter;
